<template>
	<view class="page" :style="{'min-height':h+'px','padding-top':mt+'px'}">
		<c-nav-bar title="停车导航"></c-nav-bar>
		<view v-for="(item,index) in list" :key="index">
			<view class="left">
				<!-- <view class="l_title">{{item.coordinate}}</view> -->
				<view class="l_title">{{item.parkadeName}}</view>
				<view class="l_cw">
					<view class="lc_l">车位</view>
					<view class="lc_r">剩余{{item.unusedParkingSpace}} · 全部{{item.eachAllParking}}</view>
				</view>
				<view class="l_addr">
					<image src="https://i.ringzle.com/file/20231106/e3d8756b026849a69a24980df25bf3af.png"></image>
					<!-- <text>{{item.locationIsland}}</text> -->
					<text>{{item.coordinate}}</text>
				</view>
			</view>
			<view class="right">
				<image src="https://i.ringzle.com/file/20231108/2eda42f7012d428bab045b6edb6f75d9.png" @tap="toGoHear(item)"></image>
				<view class="r_tip">去这里</view>
				<!-- <view class="r_distance">距您3.1km</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				h: uni.getSystemInfoSync().windowHeight,
				mt: uni.getSystemInfoSync().statusBarHeight + 44,
				list:[]
			}
		},
		onLoad() {
			this.getList();
		},
		methods: {
			getList(){
				this.$api.get('/travel/wisdom/ParkingNavigation/navigation?creator=0').then(res=>{
					if(res.data.code===0){
						this.list = res.data.data;
					}else this.$showModal(res.data.msg);
				})
			},
			toGoHear(item){
				uni.openLocation({
					latitude: item.latitude,
					longitude: item.longitude,
					// name: item.coordinate,
					// address: item.locationIsland
					name: item.parkadeName,
					address: item.coordinate
				})
			}
		}
	}
</script>

<style scoped lang="less">
	.page{
		background: #F5F8FA;
		padding: 20rpx 24rpx;
		&>view{
			background: #FFFFFF;
			border-radius: 10rpx;
			padding: 20rpx 24rpx 36rpx;
			box-sizing: border-box;
			margin-top: 20rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			&:first-child{
				margin-top: 0;
			}
			.left{
				.l_title{
					font-size: 32rpx;
					font-family: PingFang SC;
					font-weight: bold;
					color: #111111;
				}
				.l_cw{
					margin-top: 20rpx;
					display: flex;
					align-items: center;
					.lc_l{
						width: 70rpx;
						height: 40rpx;
						background: #06B86F;
						border-radius: 6rpx 0rpx 0rpx 6rpx;
						line-height: 40rpx;
						text-align: center;
						font-size: 24rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: #FFFFFF;
					}
					.lc_r{
						width: 248rpx;
						height: 40rpx;
						background: #F3F4F6;
						border-radius: 0rpx 6rpx 6rpx 0rpx;
						text-indent: 20rpx;
						line-height: 40rpx;
						font-size: 24rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: #111111;
					}
				}
				.l_addr{
					margin-top: 46rpx;
					display: flex;
					align-items: center;
					image{
						width: 20rpx;
						height: 24rpx;
					}
					text{
						margin-left: 10rpx;
						font-size: 24rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: #999999;
					}
				}
			}
			.right{
				display: flex;
				flex-direction: column;
				align-items: center;
				image{
					width: 70rpx;
					height: 70rpx;
				}
				.r_tip{
					margin-top: 14rpx;
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #111111;
				}
				.r_distance{
					margin-top: 13rpx;
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #999999;
				}
			}
		}
	}
</style>